package 进阶.IO.异常处理;

import java.io.FileWriter;
import java.io.IOException;

/*
* jdk1.7以前
*
* */
public class demo01 {
    public static void main(String[] args)  {
        FileWriter fw = null;
       try {
           fw = new FileWriter("d:/a.txt",true);
           fw.write("\n");
           fw.write("hello world");

       }catch (IOException e){
           e.printStackTrace();
       }finally {
          if(fw != null){
              try {
                  fw.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
       }
    }
}
